async function publish (token : number) : Promise <any> {
    try {
        await new Promise <any> ((resolve : any) : number => {
                return setTimeout (() : any => {
                        return resolve (token);
                    });
            },);
    }
    catch (err : any) {
        if (! err.statusCode) {
            throw new Error (err);
        }
    }
}
console.log (publish (42));
